package com.zqwh.xtool.api.online;


import com.zqwh.yj.sdk.utils.httpRequest.beans.HttpResult2;
import com.zqwh.xtool.domain.CategoryVO;
import com.zqwh.xtool.domain.ToolVO;

import java.util.List;

import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.POST;
import retrofit2.http.Query;
import rx.Observable;

/**
 * Created by eason.yang on 2018/1/19.
 */
public interface ToolApi {
    /**
     * epcs转Tools
     * @return
     */
    @POST("tool/epcs2tools")
    @FormUrlEncoded
    Observable<HttpResult2<List<ToolVO>>> epcs2tools(@Header("Authorization") String token, @Field("epcs") String epcs);

    /**
     * 获取RFID工具
     * @param devId
     * @return
     */
    @GET("device-tool")
    Observable<HttpResult2<List<ToolVO>>> getToolsBoundToDevice(@Header("Authorization") String token, @Query("devId") Long devId,
                                                                 @Query("categoryId") Long categoryId,
                                                                 @Query("hasRFID") Boolean hasRFID);

    /**
     * epc绑定到工具
     * @return
     */
    @POST("tool/bind-tags")
    @FormUrlEncoded
    Observable<HttpResult2<Object>> bindTags(@Header("Authorization") String token,@Field("toolId") Long toolId, @Field("tags") String tags, @Field("cover") Boolean cover);

    /**
     * 获取与设备相关的工具类目
     * @return
     */
    @GET("category/list")
    Observable<HttpResult2<List<CategoryVO>>> getCategoryList(@Header("Authorization") String token,@Query("devId") Long devId);
}
